//
//  ViewController.m
//  YSPageViewExample_OC
//
//  Created by MOLBASE on 2017/12/5.
//  Copyright © 2017年 YangShen. All rights reserved.
//

#import "ViewController.h"
#import "YSPageView.h"
#import "UIView+YSFrame.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
//    NSArray *titles = @[@"游戏", @"趣玩", @"娱乐", @"颜值", @"搞笑"];
    NSArray *titles = @[@"游戏", @"趣玩玩", @"游戏+娱乐", @"颜值颜值", @"搞笑", @"游戏游戏游戏", @"趣玩", @"游戏", @"趣玩"];
    
    NSMutableArray *childVcs = [NSMutableArray array];
    for (NSString *title in titles) {
        UIViewController *vc = [[UIViewController alloc] init];
        vc.view.backgroundColor = [UIColor randomColor];
        [childVcs addObject:vc];
    }
    
    YSPageStyle *style = [[YSPageStyle alloc] init];
//    style.isScrollEnable = NO;
//    style.isFullScreen = YES;
//    style.isDelayScroll = YES;
//    style.isShowUnderLine = YES;
//    style.isUnderLineEqualTitleWidth = YES;
//    style.titleWidth = 80;
    
    style.isShowTitleScale = YES;
    style.isShowTitleGradient = YES;
//    style.titleColorGradientStyle = YSTitleColorGradientStyleFill;
//    style.isShowTitleCover = YES;
    style.titleSelectedColor = [UIColor orangeColor];
    style.titleNormalColor = [UIColor blackColor];
    
    YSPageView *pageView = [[YSPageView alloc] initWithFrame:CGRectMake(0, 64, self.view.ys_width, self.view.ys_height - 64) titles:titles childVcs:childVcs parentVc:self style:style];
    [self.view addSubview:pageView];
}


@end
